﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Reflection;
using APILocawebGateway.VISA;

namespace TestProject.VISA
{
    [TestClass]
    public class TIDTest
    {

        [TestMethod]
        public void TesteFormataAfiliacaoVisa()
        {
            //
            Assert.AreEqual("42115", TID.FormataAfiliacaoVisa("1023421159"));
        }
        [TestMethod]
        public void TesteRecuperaUltimoDigitoDoAno()
        {
            //
            Assert.AreEqual("9", TID.RecuperaUltimoDigitoDoAno(DateTime.Now));
        }

        [TestMethod]
        public void TesteDataJuliana()
        {
            //
            Assert.AreEqual("059", TID.RecuperaDataJuliana(new DateTime(2009, 2, 28)));
            Assert.AreEqual("001", TID.RecuperaDataJuliana(new DateTime(2009, 1, 1)));
            Assert.AreEqual("090", TID.RecuperaDataJuliana(new DateTime(2009, 3, 31)));
            Assert.AreEqual("120", TID.RecuperaDataJuliana(new DateTime(2009, 4, 30)));
            Assert.AreEqual("151", TID.RecuperaDataJuliana(new DateTime(2009, 5, 31)));
            Assert.AreEqual("181", TID.RecuperaDataJuliana(new DateTime(2009, 6, 30)));
            Assert.AreEqual("212", TID.RecuperaDataJuliana(new DateTime(2009, 7, 31)));
        }
        [TestMethod]
        public void TesteRecuperaHorarioFormatoVisa()
        {
            //
            Assert.AreEqual("1505254", TID.RecuperaHorarioFormatoVisa(new DateTime(2009, 2, 21, 15, 05, 25, 400)));

        }
        [TestMethod]
        public void TesteGerarTID()
        {
            //Para testar esté método parâmetros hard-coded devem ser passados

            //ConfiguracaoVisaVBV configuracaoVisaVBV = new ConfiguracaoVisaVBV("0123456789", "1001", "", "TESTE", "VISAVBV", "133456", "www.teste.comp", "www.testeretorno");
            //Assert.AreEqual("45678903215052541001", TID.GerarTid(configuracaoVisaVBV));
        }


    }
}
